import { title } from "process";
import instance from "./request";
interface customerlistTs {
    "id":number,
      "title":string,
      "state":boolean,
      "CustomerStarRating":number,
      "contacts":string,
      "phone":number,
      "endTime":number,
      "time":number
}
//获取首页用户列表
export let http_getcustomerlsit=()=>{
    return instance.get("/customerlsit")
}
//添加首页用户列表
export let http_addcustomerlist=(obj:customerlistTs)=>{
    return instance.post("/customerlsit",obj)
}
//修改首页用户列表
export let http_editcustomerlist=(obj:customerlistTs)=>{
    return instance.patch(`/customerlsit/${obj.id}`,obj)
}
//单删 删除首页用户
export let http_delcustomerlist=(id:customerlistTs)=>{
    return instance.delete(`/customerlsit/${id}`)
}
//多条件搜索/模糊搜索
export let http_searchcustomerlist=(obj:customerlistTs)=>{
    return instance.get("/customerlsit",{params:{
        title_like:obj.title,
        state:obj.state,
        CustomerStarRating:obj.CustomerStarRating,
    }})
}

//获取数据
export let http_title=()=>{
    return instance.get('/CWtitle')
}
//添加接口
export let add_title=(obj)=>{
    return instance.post('/CWtitle',obj)
}
//编辑
export let edit_title=(obj)=>{
    return instance.patch(`/CWtitle/${obj.id}`,obj)
}
//删除
export let del_title=(id)=>{
    return instance.delete(`/CWtitle/${id}`)
}